package com.pine.common.beans.pineframework.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pine.common.util.time.TimeUtil;
import com.pine.common.util.tree.TreeInfo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 菜单表查询响应体
 * </p>
 *
 * @author pine manage
 * @since 2024-08-12
 */
@Data
@Schema(title = "SysMenuQueryResponse", description = "菜单表查询响应体")
public class SysMenuQueryResponse implements Serializable, TreeInfo<Long> {

    @Serial
    private static final long serialVersionUID = -5904017075958443989L;
    /**
     * 主键
     */
    @Schema(title = "id", description = "主键")
    private Long id;
    /**
     * 父菜单ID
     */
    @Schema(title = "parentId", description = "父菜单ID")
    private Long parentId;
    /**
     * 菜单名称
     */
    @Schema(title = "name", description = "菜单名称")
    private String name;
    /**
     * 菜单类型:1=菜单,2=目录,3=外链,4=按钮
     */
    @Schema(title = "menuType", description = "菜单类型:1=菜单,2=目录,3=外链,4=按钮")
    private Integer menuType;
    /**
     * 路由名称（Vue Router 中用于命名路由）
     */
    @Schema(title = "routeName", description = "路由名称（Vue Router 中用于命名路由）")
    private String routeName;
    /**
     * 路由路径（Vue Router 中定义的 URL 路径）
     */
    @Schema(title = "routePath", description = "路由路径（Vue Router 中定义的 URL 路径）")
    private String routePath;
    /**
     * 路由参数
     */
    @Schema(title = "routeParams", description = "路由参数")
    private String routeParams;
    /**
     * 组件路径（组件页面完整路径，相对于 src/views/，缺省后缀 .vue）
     */
    @Schema(title = "component", description = "组件路径（组件页面完整路径，相对于 src/views/，缺省后缀 .vue）")
    private String component;
    /**
     * 【按钮】权限标识
     */
    @Schema(title = "permission", description = "【按钮】权限标识")
    private String permission;
    /**
     * 显示状态:1=显示,0=隐藏
     */
    @Schema(title = "visible", description = "显示状态:1=显示,0=隐藏")
    private Integer visible;
    /**
     * 显示状态:1=显示,0=隐藏-中文描述
     */
    @Schema(title = "visible", description = "中文描述：显示状态:1=显示,0=隐藏")
    private String visibleDesc;
    /**
     * 显示顺序
     */
    @Schema(title = "sort", description = "显示顺序")
    private Integer sort;
    /**
     * 菜单图标
     */
    @Schema(title = "icon", description = "菜单图标")
    private String icon;
    /**
     * 跳转路径
     */
    @Schema(title = "redirect", description = "跳转路径")
    private String redirect;
    /**
     * 创建时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "createTime", description = "创建时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime createTime;
    /**
     * 更新时间-时间格式（yyyy-MM-dd HH:mm:ss）
     */
    @JsonFormat(pattern = TimeUtil.DEFAULT_DATE_TIME_PATTERN, timezone = TimeUtil.GMT_8)
    @Schema(title = "updateTime", description = "更新时间-时间格式（yyyy-MM-dd HH:mm:ss）")
    private LocalDateTime updateTime;

    @Override
    public Comparable<?> getWeight() {
        return sort;
    }
}
